﻿package mortal.game.view.wizard.data
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import mortal.game.resource.tableConfig.*;

    public class WizardData extends Object
    {
        public var boolNum:int;
        private var _soulId:int;
        private var _tSptite:TSprite;
        private var _spriteInfo:SpriteInfo;
        private var _tSpriteEx:TSpriteEx;
        public var isJustOpen:Boolean;

        public function WizardData(param1)
        {
            if (param1 is SpriteInfo)
            {
                this.spriteInfo = param1;
            }
            else if (param1 is int)
            {
                this.code = param1;
            }
            return;
        }// end function

        public function set spriteInfo(param1:SpriteInfo) : void
        {
            this._spriteInfo = param1;
            this.code = this._spriteInfo.SpriteCode;
            this._tSptite = WizardConfig.instance.getSpriteByCodeAndLevel(this.code, this._spriteInfo.SpriteLevel);
            this.isJustOpen = true;
            return;
        }// end function

        public function get spriteInfo() : SpriteInfo
        {
            return this._spriteInfo;
        }// end function

        public function get code() : int
        {
            return this._soulId;
        }// end function

        public function set code(param1:int) : void
        {
            this._soulId = param1;
            this._tSptite = WizardConfig.instance.getSpriteByCodeAndLevel(this.code, 1);
            this.boolNum = (WizardConfig.instance.wizardUpArr[this._soulId] as Array).length - 1;
            return;
        }// end function

        public function get tSprite() : TSprite
        {
            return this._tSptite;
        }// end function

        public function get tSpriteEx() : TSpriteEx
        {
            var _loc_1:* = this._spriteInfo == null ? (1) : (this._spriteInfo.skillCode);
            return WizardConfig.instance.getTSpriteExByCodeAndStar(this.code, _loc_1);
        }// end function

        public function get isHasWizard() : Boolean
        {
            return this._spriteInfo != null;
        }// end function

        public function get isMaxStar() : Boolean
        {
            return this._spriteInfo && this._spriteInfo.skillCode == WizardConfig.instance.getSkillTotalStar(this._tSptite.code);
        }// end function

    }
}
